package com.xingzhe.controller.test;

import java.util.ArrayList;
import java.util.List;

import javax.servlet.http.HttpServletRequest;

import com.xingzhe.commons.utils.HttpClientUtil;
import com.xingzhe.model.TbTutor;
import org.jsoup.Jsoup;
import org.jsoup.nodes.Document;
import org.jsoup.nodes.Element;
import org.jsoup.select.Elements;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;



@Controller
public class JobController {

    public static void main(String[] args) {
        String url = "http://www.gonghoo.com/Expert/main_dxdetail.action?id=";
        String id = "57182";
        url = url+id;
        String userAgent = "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.86 Safari/537.36";
        String web = HttpClientUtil.http(url, userAgent);
        Document doc = Jsoup.parse(web);
       String s =  doc.getElementsByClass("zhiku_detail_name").html();
        System.out.printf(s);
        Elements elements = doc.getElementsByClass("zhiku_detail_place");
        s = elements.get(0).child(2).html();
        System.out.printf(s);
        s = doc.getElementsByClass("zhiku_introduce_text").get(0).html();
        System.out.println(s);
    }


}
